import request from '@/utils/request'

// 查询社团信息列表
export function listOrg(query) {
  return request({
    url: '/committee/org/list',
    method: 'get',
    params: query
  })
}

// 查询社团信息详细
export function getOrg(orgId) {
  return request({
    url: '/committee/org/' + orgId,
    method: 'get'
  })
}
// 查询社团信息详细
export function getTime(data) {
  return request({
    url: '/committee/orgCourse/selectPeriod?schoolYear=' + data,
    method: 'get'
  })
}
// 报名
export function actOrg(data) {
  return request({
    url: '/committee/org/selectOneOrgClubOpen',
    method: 'post',
    data
  })
}

export function addList(data) {
  return request({
    url: '/committee/member/importData2',
    method: 'post',
    data
  })
}

export function actOrgInfo() {
  return request({
    url: '/committee/org/selectOrgOpenTime',
    method: 'post',
  })
}

// 新增社团信息
export function addOrg(data) {
  return request({
    url: '/committee/org',
    method: 'post',
    data: data
  })
}

// 修改社团信息
export function updateOrg(data) {
  return request({
    url: '/committee/org',
    method: 'put',
    data: data
  })
}

// 删除社团信息
export function delOrg(orgId) {
  return request({
    url: '/committee/org/' + orgId,
    method: 'delete'
  })
}

// 学生管理员下拉框
export function getstudentmanager(parm) {
  return request({
    url: '/committee/org/getstudentmanager/' + parm,
    method: 'get'
  })
}
// 教师管理员下拉框
export function getTeacherManager(parm) {
  return request({
    url: '/committee/org/getTeacherManager/' + parm,
    method: 'get'
  })
}
// 设置学生管理员
export function setstudentmanager(data) {
  return request({
    url: '/committee/org/setstudentmanager',
    method: 'put',
    data: data
  })
}
// 设置管理员
export function setteachermanager(data) {
  return request({
    url: '/committee/org/setteachermanager',
    method: 'put',
    data: data
  })
}

// 社团审核信息
export function editState(data) {
  return request({
    url: '/committee/org/editState',
    method: 'post',
    data: data
  })
}

// 显示二维码
export function showQrCode(orgId) {
  return request({
    url: '/committee/org/createQrCode?orgId=' + orgId,
    method: 'get',
  })
}

//下载图片
export function downloadImgs(params) {
  return request({
    url: '/common/download/url',//后端自定义的下载接口/common/download/url，路径为admin模块的com.ruoyi.web.controller.common;
    responseType: 'blob', //设置后端返回类型为二进制流，不设置会返回乱码
    method: 'get',
    params
  })
}